package com.wxw.BaseLibrary.component;

import android.graphics.Color;
import android.widget.TextView;
import com.wxw.BaseLibrary.element.IDataGridCellViewAgent;
import lombok.Getter;
import lombok.Setter;

/**
 * Created by david on 2014-06-05.
 */
public class DataGridHeadCell extends DataGridCell {
    @Getter
    @Setter
    protected int[] bgColors = null;
    @Getter
    @Setter
    protected IDataGridCellViewAgent iDataGridCellViewAgent = null;
    @Getter
    @Setter
    private int headFontColor = Color.WHITE;

    public DataGridHeadCell(DataGridViewRow parent, int col, String text){
        super(parent, col, 0, text, text, parent.getParent().get_HeadBgColor());
        fontColor = parent.getParent().get_headFontColor();
        textSize = parent.getParent().get_headFontSize();
        height = parent.getParent().getHeadHeight();
    }

    public DataGridHeadCell(DataGridViewRow parent, int col, int row, String text, int bgColor) {
        super(parent, col, row, text, text, bgColor);
        fontColor = parent.getParent().get_headFontColor();
        textSize = parent.getParent().get_headFontSize();
        height = parent.getParent().getHeadHeight();
    }

    @Override
    public void refreshCellView() {
        if (cellView != null && cellView instanceof TextView) {
            ((TextView)cellView).setTextColor(headFontColor);
        }
    }
}